﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using SaturniLibrary.Utility;

namespace SaturniLibrary.Web
{
    public class SessionManager
    {
        public static void Set(string key, object value)
        {
            HttpContext.Current.Session[key] = value;
        }
        public static object Get(string key)
        {
            return HttpContext.Current.Session[key];
        }
        public static T Get<T>(string key)
        {
            object value = HttpContext.Current.Session[key];
            return TypeConvertor.To<T>(value);
        }
        public static void Remove(string key)
        {
            HttpContext.Current.Session.Remove(key);
        }
    }
}
